<?php
require_once 'PHPUnit/Framework/TestCase.php';
require_once 'iterators/common.php';
use lapsha\iterators\common as _;

class WrapperTest extends PHPUnit_Framework_TestCase {
	public function test() {
		$i = new ArrayIterator(array(1, -1 => 2, 'a' => 3));
		$a = array();
		foreach($i as $key => $val) {
			$a[$key] = $val;
		}
		$b = array();
		foreach(new _\Wrapper($i) as $key => $val) {
			$b[$key] = $val;
		}
		$this->assertEquals($a, $b, "Both original and wrapped should be equal");
	}
}